/**
 * File: FileAccessService.java
 * Created by: mhaimel
 * Created on: 10 Aug 2009
 * CVS:  $Id: FileAccessService.java,v 1.2 2009/12/07 10:09:11 mhaimel Exp $
 */
package uk.ac.ebi.curtain.util.file;

import java.io.BufferedReader;
import java.io.File;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.nio.channels.WritableByteChannel;

import uk.ac.ebi.curtain.util.file.impl.FileAccessPool;
import uk.ac.ebi.curtain.utils.io.impl.BufferedRafReader;

import com.google.inject.ImplementedBy;

/**
 * Get IO Channel in any form (Stream, RAF,..) for a file
 * Release the channel, if not needed any more 
 * 
 * @author mhaimel
 *
 */
@ImplementedBy(FileAccessPool.class)
public interface FileAccessService {

	FileChannelAccess<BufferedRafReader> getBufferedRafReader(File file);
	FileChannelAccess<BufferedReader> getBufferedReader(File file);
	FileChannelAccess<PrintWriter> getPrintWriter(File file);
	FileChannelAccess<OutputStream> getOutputStream(File file);
	FileChannelAccess<WritableByteChannel> getWritableByteChannel(File file);

//	BufferedRafReader getBufferedRafReader(File file);
//
//	void release(BufferedRafReader channel,File file);
//	void problemWith(BufferedRafReader channel,File file);
//	
//
//	PrintWriter getPrintWriter(File file);
//	void release(PrintWriter channel,File file);
//	void problemWith(PrintWriter channel,File file);
//	
	
	void closeAll();
}
